package org.fang.controller;

import org.fang.common.PlatformResult;
import org.fang.pojo.CloudUser;
import org.fang.service.UserClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class FeignConsumerController {
    @Autowired
    RestTemplate restTemplate;
    @Qualifier("org.fang.service.UserClientService")
    @Autowired
    UserClientService service;

    public static final String URL_PREFIX = "http://localhost:8001";
    @RequestMapping("/consumer/cloudUser/add")
    public PlatformResult add(@RequestBody CloudUser user) {
        return service.add(user);
    }
    @RequestMapping("/consumer/cloudUser/queryById/{id}")
    public PlatformResult queryById(@PathVariable("id") Integer id) {
        return service.queryById(id);
    }
}
